*******************************
****AGES to Replication File***
*******************************

use "C:\Users\hsqua\Documents\Dropbox (Non Scholarship)\Academic Scholarship\Political Ambition\AGES II Survey Recoded.dta", clear
drop if genderI==1
drop if statamb==1
drop if elecamb==1
drop if execamb==1
drop if judamb==1
ren Q55 party1

gen Statamb= (4- statamb)
gen Judamb= (4- judamb)
gen Execamb= (4- execamb)
gen Elecamb= (4- elecamb)

gen female= genderI==2

keep Elecamb Statamb Judamb Execamb female age raceI educ1 party1 ideo 

cd "C:\Users\hsqua\Documents\Dropbox (Non Scholarship)\Academic Scholarship\Political Ambition\Replication Files"

save AGESReplicationData, replace

************************************
****LS Survey to Replication File***
************************************
clear

import delimited "C:\Users\hsqua\Documents\Dropbox (Non Scholarship)\Academic Scholarship\Political Ambition\Law Student Survey\AllLawSchoolsCombined (r).csv"


*Ideology, 1=Extremely Liberal, 7=Extremely Conservative
label define ideoid 1 "Extremely Liberal" 2 "Liberal" 3 "Somewhat Liberal" 4 "Moderate" 5 "Somewhat Conservative" 6"Conservative" 7 "Very Conservative"
label values ideology ideoid

gen pid7=.
replace pid7=7 if repstrength==2
replace pid7=6 if repstrength==1
replace pid7=5 if pidlean==3
replace pid7=4 if pidlean==2
replace pid7=3 if pidlean==1
replace pid7=2 if demstrength==1
replace pid7=1 if demstrength==2

gen private=0
replace private=1 if lawschool==1
replace private=1 if lawschool==2
replace private=1 if lawschool==7

gen female= gender==2

gen knowledge= blinken==4
replace knowledge = knowledge +1 if housecontrol ==2
replace knowledge = knowledge +1 if senateoveride  ==2
replace knowledge =knowledge /3

**Components of Public Service**

gen personalcomp=(reasons_8+reasons_10 +reasons_14+reasons_12+reasons_11 )/5
gen electoralcomp=(reasons_4 + reasons_3 + reasons_5+ reasons_6)/4
gen jobcomp= (reasons_1 + reasons_2 + reasons_9)/3

keep personalcomp electoralcomp jobcomp reasons_* knowledge private pid7 ideology female race latino electedofficeamb statelocalagencyamb judicialamb federalagencyamb lawschool

cd "C:\Users\hsqua\Documents\Dropbox (Non Scholarship)\Academic Scholarship\Political Ambition\Replication Files"
save LSReplicationData, replace 


******************************************
****National Survey to Replication File***
******************************************

use "C:\Users\hsqua\Documents\Dropbox (Non Scholarship)\Academic Scholarship\Political Ambition\Big KU 2019 recoded (1).dta", clear

**Drop People who failed the attention exercise
drop if Q2_2!= 6

**Create race variable with Latino included.
ren race Q35_15
gen race=.
replace race=1 if Q35_15==1 & Q35_14==2
replace race=2 if Q35_15==2 & Q35_14==2
replace race=3 if Q35_15==3 & Q35_14==2
replace race=4 if Q35_15!=5 & Q35_14==1
replace race=5 if Q35_15==4 & Q35_14==2
replace race=6 if Q35_15==5 & Q35_14==2
replace race=6 if Q35_15==5 & Q35_14==1
label define Rac 1 "White/Caucasian" 2 "Black/African-American" 3 "Asian/Asian-American" 4"Latinx" 5"Other" 6"Mixed"
label values race Rac

gen female=.
replace female=1 if gender==2
replace female=0 if gender==1

keep statamb elecamb judamb fedamb female ideo5 PartyID race age educ income polknow polint Q34_7_1 Q34_7_2 Q34_7_3 Q34_7_4 Q34_7_5 Q34_7_6 Q34_8_1 Q34_8_2 Q34_8_3 Q34_8_4 Q34_8_5 Q34_8_7 campaigning diffcampaign theJob

save NSReplicationData, replace
